package com.thoughtworks.android.androsphere.activity;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.LinearLayout;
import com.thoughtworks.android.androsphere.R;
import com.thoughtworks.android.androsphere.service.BroadcastServiceClient;

public class ComposeMessageActivity extends Activity {
    private static final String TAG = ComposeMessageActivity.class.getName();

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.compose);

        getWindow().setLayout(LinearLayout.LayoutParams.FILL_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
        findViewById(R.id.send).setOnClickListener(new View.OnClickListener() {

            public void onClick(View view) {
                String message = ((EditText) findViewById(R.id.message)).getText().toString();
                new BroadcastServiceClient(view.getContext(), message).execute();
                finish();
            }
        });
    }
}
